<script type="text/javascript">
function profile(){
	var url= root+'users/profile';
	$.post(
		url,
		$('#fr_register').serialize(),
		function(data){
			if(data.st=='SUCCESS'){
				$('.p_notification').css({'color':'#038C3C'}).html('Lưu thông tin thành công');
				setTimeout("hide_popup()",1000);
			}else{
				$.each(data.error,function(index,obj) {
					$('.p_notification').css({'color':'#EE1C25'}).html(obj.txt);
					return false;
				});
			}
		},"json"
	);
}

function check_form(element){
	var url= root+'users/check_form';
	var val= $(element).val();
	var param= element.substr(1, element.length);
	//console.debug(param);
	var post_data = {};
	post_data[param] = val;post_data['ac'] = param;
	if(val!='')
	{
		$.post(
			url,
			post_data,
			function(data){
				$.map(data.error, function(item){
					//alert(item.txt);
					console.debug(item.txt);
				});
			},"json"
		);
	}
	else
	{
		alert('*');
	}
}
</script>
<div class="popup_profile png">
<form action="" id="fr_register" method="post" enctype="multipart/form-data">
	<a href="javascript:void(0)" title="Đóng" class="close_popup" onclick="return hide_popup();"></a>
	<div class="p_content_popup">
		<div class="popup_tt"><img src="<?=PATH_URL?>static/images/popup/text/tai_khoan_thanh_vien.png" alt="" align="center" /></div>
		<div class="popup_ct">
			<div class="username">
				<span style="font-size:14px;float:left;">TÊN ĐĂNG NHẬP</span>
				<span style="margin-left:8px;float:left;">
					<span class="span_input_l"><?=$USER->username?></span>
					<div class="clearAll"></div>
				</span>	
				<div class="clearAll"></div>
			</div>
			<div class="password" style="padding:20px 0 0 46px;">
				<span style="font-size:14px;">MẬT KHẨU</span>
				<span style="margin-left:8px;"><input type="password" name="password" id="password" class="input_s" value="" /></span>
				<span style="font-size:14px;">LẶP LẠI</span>
				<span style="margin-left:8px;"><input type="password" name="re_password" id="re_password" class="input_s" value="" /></span>					
			</div>
			<div class="email" style="padding:14px 0 0 75px;">
				<span style="font-size:14px;float:left;">EMAIL</span>
				<span style="margin-left:8px;float:left;">
					<span class="span_input_l"><?=$USER->email?></span>
					<div class="clearAll"></div>
				</span>	
				<div class="clearAll"></div>			
			</div>
			<div class="fullname" style="padding:18px 0 0 42px;">
				<span style="font-size:14px;">HỌ & TÊN</span>
				<span style="margin-left:8px;"><input type="text" name="fullname" id="fullname" class="input_l" value="<?=$USER->fullname?>" /></span>				
			</div>
			<div class="information" style="padding:15px 0 0 49px;">
				<span style="font-size:14px;">SỐ CMND</span>
				<span style="margin-left:8px;"><input type="text" name="cmnd" id="cmnd" class="input_s" value="<?=$USER->cmnd?>"  /></span>		
				<span>ĐIỆN THOẠI</span>
				<span style="margin-left:8px;"><input type="text" name="phone" id="phone" class="input_s" value="<?=$USER->phone?>"  /></span>					
			</div>
			<div class="address" style="padding:15px 0px 0px 55px;">
				<span style="font-size:14px;">ĐỊA CHỈ</span>
				<span style="margin-left:8px;"><input type="text" name="address" id="" class="input_l" value="<?=$USER->address?>"  /></span>				
			</div>		
			<div class="code" style="padding:20px 0 0 39px;color:#ee1c25;">
				<span style="font-size:14px;float:left;margin:5px 0 0 0;">MÃ VẠCH SẢN PHẨM</span>
				<span style="margin-left:8px;float:left;">
					<span class="span_input_code"><?=$USER->code?></span>
					<div class="clearAll"></div>
				</span>	
				<div class="clearAll"></div>
				<input type="hidden" name="device" id="device" value="true" class="input_code" />	
			</div>
			<div class="p_notification"></div>
			<div class="button">
				<span onclick="return profile();"><img src="<?=PATH_URL?>static/images/popup/button/luu_thong_tin.png" alt="" /></span>
			</div>
		</div>
	</div>
</form>
</div>